<template>
	<view class="page flex-column">
		<view class="flex flex-column bg">
			<view class="flex1"></view>
			<view>
				<view class="flex pd-60">
					<image src="@/static/image/head.jpg" class="head" mode="widthFix"></image>
					<view class="flex1 flex-column color-white mg-left-50">
						<view class="flex1"></view>
						<view class="flex1 name">{{user.name}}</view>
						<view class="flex1"></view>
						<view class="flex1 ID">{{user.mobile}}</view>
						<view class="flex1"></view>
					</view>
				</view>
			</view>
			<view class="flex1"></view>
		</view>
		<view class="flex1">
			<view class="content-box">
				<view class="pd-60">
					<navigator class="menu flex flex-center" hover-class="none" :url="'../order/order-list?uid=' + userId">
						<image class="menu-icon" src="@/static/icon/icon-order.png" mode="widthFix"></image>
						<text class="menu-title flex1 font-32">我的订单</text>
						<image class="right" src="@/static/icon/right.png" mode="widthFix"></image>
					</navigator>
					
					<navigator class="menu flex flex-center" hover-class="none" url="./question">
						<image class="menu-icon" src="@/static/icon/icon-ask.png" mode="widthFix"></image>
						<text class="menu-title flex1 font-32">常见问题</text>
						<image class="right" src="@/static/icon/right.png" mode="widthFix"></image>
					</navigator>
					
					<!-- <view class="menu flex flex-center" @click="toKefu">
						<image class="menu-icon" src="@/static/icon/icon-kefu.png" mode="widthFix"></image>
						<text class="menu-title flex1 font-32">客服中心</text>
						<image class="right" src="@/static/icon/right.png" mode="widthFix"></image>
					</view> -->
					
					<view class="menu flex flex-center">
						<image class="menu-icon" src="@/static/icon/icon-mobile.png" mode="widthFix"></image>
						<text class="menu-title flex1 font-32">服务热线</text>
						<view @click="call">
							<view class="mobile">400-007-2201</view>
							<view class="time">工作日9:30-18:00</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import callmobile from '@/utils/mobile.js'
	import order from '@/api/order.js'
	
	export default {
		data() {
			return {
				kefuUrl: 'https://work.weixin.qq.com/kfid/kfcbf7b079a02003a85',
				userId: 0,
				user: {
					name: '',
					mobile: ''
				}
			};
		},
		created(option) {
			this.userId = this.$route.query.uid;
			this.getUser()
		},
		methods:{
			call() {callmobile()},
			getUser() {
				order.getUser(this.userId).then(res => {
					this.user.name = res.data.user_name;
					this.user.mobile = res.data.mobile;
				})
			},
			toKefu() {
				location.href = this.kefuUrl;
			}
		}
	}
</script>

<style lang="scss">
.bg{
	height: 500rpx;
	background-color: red;
	background-image: url('@/static/image/center-bg.png');
	background-size: 100% auto;
	background-repeat: no-repeat;
	background-position: top center;
	
	.head{
		width: 110rpx;
		height: 110rpx;
		border-radius: 50%;
	}
	.name{
		font-size: 40rpx;
	}
	.ID{
		font-size: 32rpx;
		margin-top: 5rpx;
	}
}

.content-box{
	margin-top: -50rpx;
	border-top-left-radius: 44rpx;
	border-top-right-radius: 44rpx;
	background-color: #fff;
	.menu{
		border-bottom: 1px solid #E9E9E9;
		padding: 30rpx 0;
	}
	
	.menu-icon{
		width: 40rpx;
	}
	.menu-title{
		color: #232323;
		font-weight: bold;
		margin-left: 20rpx;
	}
	
	.right{
		width: 30rpx;
	}
	
	.mobile{
		font-size: 32rpx;
		color: #FE761B;
		font-weight: bold;
	}
	.time{
		font-size:22rpx;
		color:#999999;
		text-align: right;
	}
}
</style>
